package com.twc.tomcat;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;

public class SpringApplication {
    public static void run() throws LifecycleException, IOException, ServletException {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(6666);
        tomcat.addWebapp("/", new File("").getCanonicalPath());
        tomcat.start();
        tomcat.getServer().await();
    }
}
